import { Unitl } from "./Unitl";

Unitl.PrintStartTime();
Unitl.PrintOpeationName("方法");

//剩余参数写法； ...名字:类型
function MyFunc(a = 10,b:string,c?:boolean,...res:number[]):string{
    return `$a ${a} 是参数默认值,b ${b} 是传入值,
            c ${c} 是可选值,res ${res} 是剩余参数`;
}

const result = MyFunc(10,"HiHi",true,1,2,3,4,5,6);
console.log(result);

function Func(a = 999):number{
    return a;
}
console.log(Func());

Unitl.PrintOpeationName("接口");

interface IUp{
     name:string;
     age:number;

     Up():void;
}

let APerson:IUp = {
    name: "张三",
    age: 16,
    Up: function (): void {
       let age:number = this.age;
        age += 1;
     console.log(`张三成长了一岁，现在${age}岁了`);   
    }
};

APerson.Up();